﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Nizm0.QOT.Library.Objects
{
    class LocalFile// : System.IO.File
    {
        private string _fileName;
        private string _fileExtension;

        private string _actualDirectory;
        private string _directory;
        private bool _isDependentDirectory;

        public enum SpecialFolders { ProjectFolder, RuningApplicationFolder, MyDocuments, UserProfile }

        public LocalFile(string file)
        {
            var tmpFileInfo = new System.IO.FileInfo(file);
            _fileName = tmpFileInfo.Name;
            _fileExtension = tmpFileInfo.Extension;
            _actualDirectory = tmpFileInfo.DirectoryName;

            var folders = Enum.GetNames(typeof (Environment.SpecialFolder)).ToArray();
            foreach (string tmpStr in folders)
            {
                if (
                    file.Contains(
                        Environment.GetFolderPath(
                            (Environment.SpecialFolder) Enum.Parse(typeof (Environment.SpecialFolder), tmpStr))))
                {
                    _isDependentDirectory = true;
                    _directory = _directory.Remove(0, Environment.GetFolderPath(
                        (Environment.SpecialFolder) Enum.Parse(typeof (Environment.SpecialFolder), tmpStr)).Length);
                }
            }
            //string folderPath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
        }
    }
}
